<%@page import="java.util.Enumeration"%>
<%@page import="org.email4java.association.Association"%>
<%@ page import="org.email4java.server.RealmVerifier"%>
<%@ page import="org.email4java.consumer.SessionAssociationStore" %>
<%@ page import="org.email4java.consumer.SessionNonceVerifier" %>

<%-- 
	init the consumer manager  
	provide the special session- storage for the Association and the Nonces...

--%>

<%

System.out.println("------------------------------------- INIT --- ");

//  --- Forward proxy setup (only if needed) ---
ProxyProperties proxyProps = new ProxyProperties();
proxyProps.setProxyHostName("wwwcache.sanger.ac.uk");
proxyProps.setProxyPort(3128);
HttpClientFactory.setProxyProperties(proxyProps);
System.out.println("proxy setup");
%>

<% 
Object o = session.getAttribute("consumermanager");
if (o == null)
{
    ConsumerManager newmgr=new ConsumerManager();
    newmgr.setAssociations(new InMemoryConsumerAssociationStore());
    newmgr.setNonceVerifier(new InMemoryNonceVerifier(5000));
    
    session.setAttribute("consumermanager", newmgr);
}
ConsumerManager manager=(ConsumerManager) session.getAttribute("consumermanager");
email=request.getParameter("email");
System.out.println("email in consumer_init.jsp="+email);

%>